import Vue from 'vue'
import VueRouter from 'vue-router'

const Index = () => import('../views/Index.vue')
const Login = () => import('../views/Login.vue')
const Userinfo = () => import('../views/Userinfo.vue')
const administratorrole = () => import('../views/administratorrole.vue')
const Repairs = () => import('../views/Repairs.vue')
const Questions = () => import('../views/Questions.vue')
const Staffs = () => import('../views/Staffs.vue')
const building = () => import('../views/building.vue')
const homepage = () => import('../views/homepage.vue')
const houses = () => import('../views/houses.vue')
const administrator = () => import('../views/administrator.vue')
const news = () => import('../views/news.vue')
const stores = () => import('../views/stores.vue')
const fee = () => import('../views/fee.vue')
const advertisement = () => import('../views/advertisement.vue')
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: Login
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/index',
    name: 'index',
    component: Index,
    redirect:'/homepage',
    children: [
      {
        path: '/fee',
        name: 'fee',
        component: fee
      },
      {
        path: '/advertisement',
        name: 'advertisement',
        component: advertisement
      },
      {
        path: '/homepage',
        name: 'homepage',
        component: homepage
      },
      {
        path: '/building',
        name: 'building',
        component: building
      },
      {
        path: '/news',
        name: 'news',
        component: news
      },
      {
        path: '/Staffs',
        name: 'Staffs',
        component: Staffs
      },
      {
        path: '/administratorrole',
        name: 'administratorrole',
        component: administratorrole
      },
      {
        path: '/repairs',
        name: 'repairs',
        component: Repairs
      },
      {
        path: '/userinfo',
        name: 'userinfo',
        component: Userinfo
      },
      {
        path: '/questions',
        name: 'questions',
        component: Questions
      },
      {
        path: '/houses',
        name: 'houses',
        component: houses
      },
      {
        path: '/administrator',
        name: 'administrator',
        component: administrator
      },
      {
        path: '/stores',
        name: 'stores',
        component: stores
      },
    ]

  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
